import {file, parse} from './globals.js';
import ding from './images/image-ding.jpg';
import styles from './styles.css';
import index from './index.scss';

console.log(styles);
console.log(index);

async function getComponent() {
  var element = document.createElement('div');
  var button = document.createElement('button');
  var br = document.createElement('br');
  var image = document.createElement('img');
  image.src = ding;

  button.innerHTML = '点击我检查控制台!!!';

  element.innerHTML = join(['Hello', 'webpack'], ' ');
  element.appendChild(br);
  element.appendChild(button);
  element.appendChild(br);
  element.appendChild(image);

  console.log(parse());

  button.onclick = e => import(/* webpackChunkName: "print" */ './print').then(module => {
    var print = module.default;
    print();
  });

  return element;
}

getComponent().then(component => {
  document.body.appendChild(component);
});